package it.unibz.ti2.internetPizzeria.entities;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

/**
 * Storing information about products
 */
@Entity
@Table(name = "PRODUCTS")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(
    name="producttype",
    discriminatorType=DiscriminatorType.STRING
)
@DiscriminatorValue("Product")
public abstract class Product {

	@Id
	@GeneratedValue
	@Column(name = "PRODUCT_ID")
	long id;

	@Column(name = "PRODUCT_NAME")
	String name;

	@Column(name = "PRODUCT_DESCRIPTION")
	String description;

	@Column(name = "PRODUCT_AVAILABLE")
	boolean available;

	@Column(name = "PRODUCT_PRICE")
	float price;

	public boolean isAvailable() {
		return available;
	}

	public void setAvailable(boolean available) {
		this.available = available;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public float getPrice() {
		return price;
	}

	public void setPrice(float price) {
		this.price = price;
	}
	
	
}
